<!DOCTYPE html>
<html>
<head>
    <title></title>
    <style>
        #clock{
            width:200px;
            height:40px;
            text-align: center;
            border:1px solid #000;
            margin:100px auto 0px;
            font-size:18px;
            line-height:40px;
        }
    </style>
</head>
<body>
    <div id="clock"></div>
</body>

    <script>
        var clock = document.getElementById("clock");

        setInterval(getTime,1000);

        function getTime(){
            
            var date = new Date();

            var h = date.getHours();

            var m = date.getMinutes();

            var s = date.getSeconds();

            if(h<10){
                h = '0'+h;
            }
            if(m<10){
                m = '0'+m;
            }
             if(s<10){
                s = '0'+s;
            }

            var tNow = h+':'+m+":"+s;

            clock.innerHTML = tNow;
        }
    </script>
</html>